using System;
using System.Collections.Generic;
using Module.Core.DAO;
using Module.Core.EntitiesInfo;
using Module.Common.Models;


namespace Module.Core.BusinessLogic
{
    public class AdvertisementBL
    {
        #region
        /// <summary>
		/// Saves a record to the Advertisement table.
		/// </summary>
        public static int Insert(AdvertisementInfo advertisementInfo)
		{
			try
			{
			  return  new AdvertisementDAO().Insert(advertisementInfo);
			}
			catch (Exception ex)
			{
				throw;
			}

		}

		/// <summary>
		/// Saves a record to the Advertisement table.
		/// </summary>
        public static void Update(AdvertisementInfo advertisementInfo)
		{
			try
			{
				new AdvertisementDAO().Update(advertisementInfo);
			}
			catch (Exception ex)
			{
				throw;
			}

		}

		/// <summary>
		/// Delete a record from the Advertisement table.
		/// </summary>
        public static void Delete(int advertisementId, int positionId)
		{
			try
			{
                new AdvertisementDAO().Delete(advertisementId, positionId);
			}
			catch (Exception ex)
			{
				throw;
			}

		}

		/// <summary>
		/// Selects a single record from the Advertisement table.
		/// </summary>
        public static AdvertisementInfo Select(int advertisementID)
		{
			try
			{
				return new AdvertisementDAO().Select(advertisementID);
			}
			catch (Exception ex)
			{
				throw;
			}

		}

		/// <summary>
		/// Selects all records from the Advertisement table.
		/// </summary>
        public static CHRTList<AdvertisementInfo> SelectAll()
		{
			try
			{
				return new AdvertisementDAO().SelectAll();
			}
			catch (Exception ex)
			{
				throw;
			}
        }
        public static void WriteXmlBanner(string fileNameXML, string pathWriteXML)
        {
            try
            {
                new AdvertisementDAO().WriteXmlBanner(fileNameXML,pathWriteXML);
            }
            catch (Exception)
            {
                
                throw;
            }
        }
        #endregion
    }
}
